package com.softWang.system.controller.vo.systemAuth;

import com.baomidou.mybatisplus.annotation.TableId;
import com.softWang.system.po.SystemMenu;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

@ApiModel
@Data
public class UserInfoResult {

    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "用户名")
    private String uname;


    @ApiModelProperty(value = "登录账户")
    private String loginName;

    @ApiModelProperty(value = "所属部门id")
    private Long deptid;

    @ApiModelProperty(value = "性别，1:男;2:女;0:未知")
    private Integer sex;

    @ApiModelProperty(value = "用户头像")
    private Long avatar;

    @ApiModelProperty(value = "菜单列表")
    private List<MenuInfo> menuList;

    @ApiModelProperty(value = "权限标识列表")
    private Set<String> permissions;

    @ApiModelProperty(value = "角色标识列表")
    private Set<String> roleCodes;

    @Data
    public static class MenuInfo{
        @ApiModelProperty(value = "主键id")
        @TableId
        private Long id;


        @ApiModelProperty(value = "名称，长度为60")
        @NotBlank(message = "mname不能为空")
        @Size(max = 60,message="mname长度为60")
        private String mname;

        @ApiModelProperty(value = "父id")
        @NotNull(message = "pid不能为空")
        private Long pid;

        @ApiModelProperty(value = "类型{分类:1,菜单:2,按钮:3}")
        @NotNull(message = "type不能为空")
        private Integer type;

        @ApiModelProperty(value = "页面路由或按钮标识，长度为60")
        @Size(max = 60,message="mkey长度为60")
        private String mkey;

        @ApiModelProperty(value = "后台权限标识如system:user:query")
        private String permission;

        @ApiModelProperty(value = "菜单图标")
        private String icon;

        @ApiModelProperty(value = "路由地址path全路径")
        private String url;

    }
}
